<script language="javascript" src="__PUBLIC__/Printer/LodopFuncs.js"></script>
<object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
	<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="__PUBLIC__/Printer/install_lodop.exe"></embed>
</object> 

<script language="javascript">
var LODOP; //声明为全局变量
function myPreview() {	
	LODOP=getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
	LODOP.PRINT_INITA(0,0,800,970,"绿风OA办公系统_发货标签");
	LODOP.SET_PRINT_PAGESIZE(3,0,0,"A4");
	createAllPages();
	if (LODOP.PREVIEW())
	{
		$.getJSON(
		"__URL__/doPrint/navTabId/{$Think.const.MODULE_NAME}/id/{$id}",
		function(json)
		{         
			if (json['status'])
			{
				alertMsg.correct(json['msg']);
			}
			else
			{
				alertMsg.error(json['msg']);
			}
			if (json['navTabId'])
			{
				navTab.reload(null, {}, json['navTabId']);
			}
			$.pdialog.closeCurrent();
		}
	); 
	}
	else
	{
		
	}
};

function createAllPages()
{
	index = 0;
	offsetTop = 0;
	<volist name="printList" id="printVo" key="key">
	if ((index % 12) == 0)
	{
		LODOP.NewPage();
		offsetTop = 0;
	}	
	if ({$key} % 2)
	{
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,400,100,20,"{$printVo.magazineName}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,500,40,20,"{$printVo.termName}期");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,540,70,20,"{$todayDate}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,610,55,20,"第"+ (parseInt(index / 12) + 1) +"页");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,665,80,20,"{$printVo.sendGoodsTypeID|get_send_goods_type_name}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 70,400,160,20,"邮编：{$printVo.zipCode}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 90,400,200,20,"{$printVo.recAddress}");
		LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
		LODOP.ADD_PRINT_TEXT(offsetTop + 90,600,150,20,"({$printVo.memo})");
		LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,400,90,20,"{$printVo.recPeople}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,490,60,20,"数量{$printVo.sendNum}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,550,40,20,"{$printVo.beginTermID|get_magazine_terrm_name}-{$printVo.endTermID|get_magazine_terrm_name}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,590,50,20,"印刷品");
		LODOP.ADD_PRINT_TEXT(offsetTop + 130,400,70,20,"{$printVo.postPeople|get_employee_name}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 130,470,270,20,"河南教育读物发行总社有限公司 0371-65965766");
		LODOP.ADD_PRINT_TEXT(offsetTop + 150,400,350,20,"郑州市红旗路东段99号  邮编450008");
	}
	else
	{
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,40,100,20,"{$printVo.magazineName}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,140,40,20,"{$printVo.termName}期");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,180,70,20,"{$todayDate}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,250,55,20,"第"+ (parseInt(index / 12) + 1) +"页");
		LODOP.ADD_PRINT_TEXT(offsetTop + 50,305,80,20,"{$printVo.sendGoodsTypeID|get_send_goods_type_name}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 70,40,160,20,"邮编：{$printVo.zipCode}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 90,40,200,20,"{$printVo.recAddress}");
		LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
		LODOP.ADD_PRINT_TEXT(offsetTop + 90,240,150,20,"({$printVo.memo})");
		LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,40,90,20,"{$printVo.recPeople}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,130,60,20,"数量{$printVo.sendNum}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,190,40,20,"{$printVo.beginTermID|get_magazine_terrm_name}-{$printVo.endTermID|get_magazine_terrm_name}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 110,230,50,20,"印刷品");
		LODOP.ADD_PRINT_TEXT(offsetTop + 130,40,70,20,"{$printVo.postPeople|get_employee_name}");
		LODOP.ADD_PRINT_TEXT(offsetTop + 130,110,270,20,"河南教育读物发行总社有限公司 0371-65965766");
		LODOP.ADD_PRINT_TEXT(offsetTop + 150,40,350,20,"郑州市红旗路东段99号  邮编450008");

		offsetTop = offsetTop + 160;
	}

	index++;
	
	</volist>
	
};	
</script>


<div class="page">

	<div class="pageContent">

		<div class="panelBar">			
			<ul class="toolBar">
				<li><input type="button" value="打印预览" onClick="myPreview()"/></li>
			</ul>
		</div>

		<table class="table" width="100%" layoutH="88" id="PrintList">
			<thead>
			<tr>
				<th width="50">编号</th>
				<th width="80">期数</th>
				<th width="80">月份</th>
				<th width="100">收货人</th>
				<th width="80">省份</th>
				<th width="80">城市</th>				
				<th width="80">单位</th>
				<th width="80">班级</th>
				<th width="100">电话</th>
				<th width="80">地址</th>
				<th width="160">报刊名称</th>
				<th width="80">份数</th>
				<th width="60">发行员</th>
				<th width="80">发货方式</th>
				<th width="80">是否打印发货标签</th>
				<th width="80">标签编号</th>
			</tr>
			</thead>
			<tbody>
			<volist id="vo" name="list">
				<tr target="id" rel="{$vo.id}" key="key">
					<td>{$key + 1}</td>
					<td>{$vo.termName}</td>
					<td>{$vo.termMonth}</td>
					<td>{$vo.recPeople}</td>
					<td>{$vo.provinceID|get_province_name}</td>
					<td>{$vo.cityName}</td>
					<td>{$vo.schoolID|get_custom_unit_name}</td>
					<td>{$vo.class}</td>
					<td>{$vo.recTelphone}</td>
					<td>{$vo.recAddress|msubstr=0,10}</td>
					<td>{$vo.magazineName}</td>
					<td>{$vo.sendNum}</td>
					<td>{$vo.postPeople|get_employee_name}</td>
					<td>{$vo.sendGoodsTypeID|get_send_goods_type_name}</td>
					<td><if condition="$vo.isPrintSendLabel eq 1">是<else />否</if></td>
					<td>{$vo.sendLabelNum}</td>
				</tr>
			</volist>
			</tbody>
		</table>
	</div>
	
</div>

